<template>
  <el-form
    class="pcShow"
    :size="formConf.size"
    :label-position="formConf.labelPosition"
    :disabled="formConf.disabled"
    :label-width="formConf.labelWidth + 'px'"
  >
    <RowContainerShow :formItem="formItem" :gutter="formConf.gutter" />
  </el-form>
</template>

<script>
import { deepClone } from "../utils/index";
export default {
  name: "pcShow",
  props: {
    formList: {
      type: Array,
      default: () => []
    },
    formConf: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      formItem: {
        type: "",
        justify: "",
        align: "",
        __config__: { children: [] }
      }
    };
  },

  watch: {
    formList: {
      immediate: true,
      deep: true,
      handler(newValue, oldValue) {
        if (newValue) {
          this.formItem.__config__.children = deepClone(newValue);
        }
      }
    }
  },

  methods: {}
};
</script>

<style lang="scss">
.pcShow {
  .drawing-item {
    cursor: auto;
  }
}
</style>
